package com.itheima.day07;

import com.sun.source.tree.Tree;

import java.util.*;

public class Practice1 {
    /**## 题目1

     ![](./img/1568172819505.png)

     ```
     如图所示:有四名学生参加注册会计师考试,表格中记录的是4名学生的考试成绩,请按照成绩将四名学生从小到大进行排名,并将结果展示出来.
     ```

     ### 训练目标 */
    public static void main(String[] args) {
         List<Student> list = new ArrayList<>();
         list.add(new Student("张三",100));
         list.add(new Student("李四",70));
         list.add(new Student("王五",80));
        Collections.sort(list,(s1,s2)->Double.compare(s1.getScore(), s2.getScore()));
        System.out.println(list);

        Map<String,Integer> map = new TreeMap<>(new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return 0;
            }
        });

    }
}
class Student{
    private String name;
    private double score;

    public Student() {
    }

    public Student(String name, double score) {
        this.name = name;
        this.score = score;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }
}